import os
import pandas as pd
import matplotlib.pyplot as plt

os.chdir('PATH')

dd=pd.read_csv('Data_extended1a.csv',index_col=0) # Drought optimized fastSIR simulation result
EMM = pd.read_csv('Data_Fig2a_1.csv', index_col=0) # Drought data with negative sentiment and network information

Emp_data = EMM[112:]
Emp_data['Count'] = Emp_data['Count'] - Emp_data['Count'][112]
Emp_data = Emp_data.reset_index(drop=True)

plt.rcParams['font.size'] = 14
plt.figure(dpi=400,figsize=(10,4.8))
xx = 194
plt.fill_between(range(0,xx,1), dd['bR'][:xx]/20164*100,dd['tR'][:xx]/20164*100,facecolor='red',interpolate=True
                 , alpha = 0.3)
plt.plot(range(0,xx,1), dd['mR'][:xx]/20164*100, color='red',label='fastSIR')
plt.plot(range(0,xx,1), Emp_data[:xx].Count/20164*100, color='black',linestyle='-',label='Twitter')
plt.axvline(x=30,color='gray',linestyle='--')
plt.axvline(x=45,color='gray',linestyle='--')
plt.text(31,71,'t=30')
plt.text(46,61,'t=45')
plt.axhline(y=0.00,color='black',linestyle=':')
plt.axhline(y=10,color='black',linestyle=':')
plt.axhline(y=20,color='black',linestyle=':')
plt.axhline(y=30,color='black',linestyle=':')
plt.axhline(y=40,color='black',linestyle=':')
plt.axhline(y=50,color='black',linestyle=':')
plt.axhline(y=60,color='black',linestyle=':')
plt.axhline(y=70,color='black',linestyle=':')
plt.axhline(y=80,color='black',linestyle=':')
plt.axhline(y=90,color='black',linestyle=':')
plt.xticks(range(0,xx,45))
plt.ylabel('Percentage [%]')
plt.xlim([0,xx-1])
plt.legend()
plt.show()


